package com.ruoyi.project.jiaqin.reportsupply.service.impl;

import java.util.List;
import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.jiaqin.reportsupply.mapper.ReportSupplyMapper;
import com.ruoyi.project.jiaqin.reportsupply.domain.ReportSupply;
import com.ruoyi.project.jiaqin.reportsupply.service.IReportSupplyService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 举报供应Service业务层处理
 *
 * @author admin
 * @date 2020-12-31
 */
@Service
public class ReportSupplyServiceImpl implements IReportSupplyService
{
    @Autowired
    private ReportSupplyMapper reportSupplyMapper;

    /**
     * 查询举报供应
     *
     * @param id 举报供应ID
     * @return 举报供应
     */
    @Override
    public ReportSupply selectReportSupplyById(String id)
    {
        return reportSupplyMapper.selectReportSupplyById(id);
    }

    /**
     * 查询举报供应列表
     *
     * @param reportSupply 举报供应
     * @return 举报供应
     */
    @Override
    public List<ReportSupply> selectReportSupplyList(ReportSupply reportSupply)
    {
        return reportSupplyMapper.selectReportSupplyList(reportSupply);
    }

    /**
     * 新增举报供应
     *
     * @param reportSupply 举报供应
     * @return 结果
     */
    @Override
    public int insertReportSupply(ReportSupply reportSupply)
    {
        reportSupply.setId(UUID.randomUUID().toString().replace("-",""));
        return reportSupplyMapper.insertReportSupply(reportSupply);
    }

    /**
     * 修改举报供应
     *
     * @param reportSupply 举报供应
     * @return 结果
     */
    @Override
    public int updateReportSupply(ReportSupply reportSupply)
    {
        return reportSupplyMapper.updateReportSupply(reportSupply);
    }

    /**
     * 删除举报供应对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteReportSupplyByIds(String ids)
    {
        return reportSupplyMapper.deleteReportSupplyByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除举报供应信息
     *
     * @param id 举报供应ID
     * @return 结果
     */
    @Override
    public int deleteReportSupplyById(String id)
    {
        return reportSupplyMapper.deleteReportSupplyById(id);
    }
}
